package com.atguigu.gulimall.product.dao;

import com.atguigu.gulimall.product.entity.AttrEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

/**
 * 商品属性
 * 
 * @author YuGuoJian
 * @email yu925074596@163.com
 * @date 2021-11-22 22:27:49
 */
@Mapper
public interface AttrDao extends BaseMapper<AttrEntity> {

    @Select("<script>" +
            " select attr_id from pms_attr where search_type = 1 and attr_id in " +
            "<foreach item='id'  index='index'  collection='longList' " +
            "open='(' separator=',' close=')'> " +
            "#{id}" +
            "</foreach>" +
            "</script>")
    List<Long> selectSearchAttrs(@Param("longList") List<Long> longList);
}
